package com.imut.lagain.entity;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import jakarta.persistence.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.time.LocalDateTime;

/**
 * 答案锁备份实体类
 */
@Entity
@Table(name = "answer_lock_backup")
@TableName("answer_lock_backup")
public class AnswerLockBackup {
    private static final Logger log = LoggerFactory.getLogger(AnswerLockBackup.class);

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @Column(name = "user_id", nullable = false)
    @TableField("user_id")
    private Long userId;

    @Column(name = "original_answer_id")
    @TableField("original_answer_id")
    private Long originalAnswerId;

    @Column(name = "backup_content", columnDefinition = "TEXT")
    @TableField("backup_content")
    private String backupContent;

    @Column(name = "backup_type")
    @TableField("backup_type")
    private String backupType;

    @Column(name = "backup_reason")
    @TableField("backup_reason")
    private String backupReason;

    @Column(name = "created_at")
    @TableField("created_at")
    private LocalDateTime createdAt;

    @Column(name = "restored_at")
    @TableField("restored_at")
    private LocalDateTime restoredAt;

    @Column(name = "is_restored")
    @TableField("is_restored")
    private Boolean isRestored = false;

    @Column(name = "is_deleted")
    @TableField("is_deleted")
    private Boolean isDeleted = false;

    public AnswerLockBackup() {
        this.createdAt = LocalDateTime.now();
        this.isRestored = false;
        this.isDeleted = false;
    }

    // Getters and Setters
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getOriginalAnswerId() {
        return originalAnswerId;
    }

    public void setOriginalAnswerId(Long originalAnswerId) {
        this.originalAnswerId = originalAnswerId;
    }

    public String getBackupContent() {
        return backupContent;
    }

    public void setBackupContent(String backupContent) {
        this.backupContent = backupContent;
    }

    public String getBackupType() {
        return backupType;
    }

    public void setBackupType(String backupType) {
        this.backupType = backupType;
    }

    public String getBackupReason() {
        return backupReason;
    }

    public void setBackupReason(String backupReason) {
        this.backupReason = backupReason;
    }

    public LocalDateTime getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(LocalDateTime createdAt) {
        this.createdAt = createdAt;
    }

    public LocalDateTime getRestoredAt() {
        return restoredAt;
    }

    public void setRestoredAt(LocalDateTime restoredAt) {
        this.restoredAt = restoredAt;
    }

    public Boolean getIsRestored() {
        return isRestored;
    }

    public void setIsRestored(Boolean isRestored) {
        this.isRestored = isRestored;
    }

    public Boolean getIsDeleted() {
        return isDeleted;
    }

    public void setIsDeleted(Boolean isDeleted) {
        this.isDeleted = isDeleted;
    }
}